/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bam;

/**
 *
 * @author Administrator
 */
public class LoanSavingAccount extends SavingsAccount implements Loan{
    private double loan=0;
    public void requestLoan(double x) {
        this.loan=x;
        this.setBalance(this.getBalance()+x);
    }

    public void payLoan(double x) {
        if(this.getBalance()>=x){
        this.loan-=x;
        this.setBalance(this.getBalance()-x);
        }
    }
    public double getLoan() {
       return this.loan;
    }
    public boolean equals(Account x){
	    if(x != null && x instanceof LoanSavingAccount){
	        return true;
	    }
	    return false;
	}
}
